/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * PnlListType.java
 *
 * Created on 14 ม.ค. 2553, 11:16:34
 */

package warehouse;

/**
 *
 * @author Administrator
 */
public class PnlListType extends javax.swing.JPanel {

    /** Creates new form PnlListType */
    public PnlListType() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        pnlHeadListType = new javax.swing.JPanel();
        lblHeadListType = new javax.swing.JLabel();
        btnTypeListSearch = new javax.swing.JButton();
        btnTypeListAdd = new javax.swing.JButton();
        btnTypeListDel = new javax.swing.JButton();
        btnTypeListEdit = new javax.swing.JButton();
        btnTypePrint = new javax.swing.JButton();
        pnlListType = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        tblListType = new javax.swing.JTable();
        lblTyCode = new javax.swing.JLabel();
        txtTyCode = new javax.swing.JTextField();
        lblTyName = new javax.swing.JLabel();
        txtTyName = new javax.swing.JTextField();

        setMaximumSize(new java.awt.Dimension(700, 500));
        setMinimumSize(new java.awt.Dimension(700, 500));
        setPreferredSize(new java.awt.Dimension(700, 500));
        setLayout(new java.awt.BorderLayout());

        pnlHeadListType.setBackground(new java.awt.Color(204, 255, 204));
        pnlHeadListType.setPreferredSize(new java.awt.Dimension(700, 80));

        lblHeadListType.setFont(new java.awt.Font("Tahoma", 1, 16)); // NOI18N
        lblHeadListType.setText("จัดการประเภทสินค้า");

        btnTypeListSearch.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/search_30x30.gif"))); // NOI18N

        btnTypeListAdd.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/add_30x30.gif"))); // NOI18N

        btnTypeListDel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/del_30x30.gif"))); // NOI18N

        btnTypeListEdit.setFont(new java.awt.Font("Tahoma", 0, 14));
        btnTypeListEdit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/edit1_30x30.gif"))); // NOI18N
        btnTypeListEdit.setMaximumSize(new java.awt.Dimension(75, 30));
        btnTypeListEdit.setMinimumSize(new java.awt.Dimension(75, 30));
        btnTypeListEdit.setPreferredSize(new java.awt.Dimension(75, 30));

        btnTypePrint.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/print_30x30.gif"))); // NOI18N
        btnTypePrint.setMaximumSize(new java.awt.Dimension(40, 40));
        btnTypePrint.setMinimumSize(new java.awt.Dimension(40, 40));
        btnTypePrint.setPreferredSize(new java.awt.Dimension(40, 40));

        javax.swing.GroupLayout pnlHeadListTypeLayout = new javax.swing.GroupLayout(pnlHeadListType);
        pnlHeadListType.setLayout(pnlHeadListTypeLayout);
        pnlHeadListTypeLayout.setHorizontalGroup(
            pnlHeadListTypeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlHeadListTypeLayout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addGroup(pnlHeadListTypeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblHeadListType)
                    .addGroup(pnlHeadListTypeLayout.createSequentialGroup()
                        .addComponent(btnTypeListSearch, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnTypeListAdd, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnTypeListDel, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnTypeListEdit, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnTypePrint, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(440, Short.MAX_VALUE))
        );
        pnlHeadListTypeLayout.setVerticalGroup(
            pnlHeadListTypeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlHeadListTypeLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addGroup(pnlHeadListTypeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(btnTypePrint, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(pnlHeadListTypeLayout.createSequentialGroup()
                        .addComponent(lblHeadListType)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(pnlHeadListTypeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(btnTypeListSearch, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(btnTypeListAdd, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(btnTypeListDel, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(btnTypeListEdit, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap())
        );

        add(pnlHeadListType, java.awt.BorderLayout.PAGE_START);

        tblListType.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        tblListType.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "รหัสประเภทสินค้า", "ชื่อประเภท"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane1.setViewportView(tblListType);

        lblTyCode.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        lblTyCode.setText("รหัสประเภทสินค้า :");

        txtTyCode.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        txtTyCode.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtTyCodeActionPerformed(evt);
            }
        });

        lblTyName.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        lblTyName.setText("ชื่อประเภทสินค้า :");

        txtTyName.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        txtTyName.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtTyNameActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout pnlListTypeLayout = new javax.swing.GroupLayout(pnlListType);
        pnlListType.setLayout(pnlListTypeLayout);
        pnlListTypeLayout.setHorizontalGroup(
            pnlListTypeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlListTypeLayout.createSequentialGroup()
                .addGroup(pnlListTypeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlListTypeLayout.createSequentialGroup()
                        .addGap(20, 20, 20)
                        .addComponent(lblTyCode)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(txtTyCode, javax.swing.GroupLayout.PREFERRED_SIZE, 156, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(lblTyName)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(txtTyName, javax.swing.GroupLayout.PREFERRED_SIZE, 217, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(pnlListTypeLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 680, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        pnlListTypeLayout.setVerticalGroup(
            pnlListTypeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlListTypeLayout.createSequentialGroup()
                .addGap(19, 19, 19)
                .addGroup(pnlListTypeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblTyCode)
                    .addComponent(txtTyCode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblTyName)
                    .addComponent(txtTyName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(211, Short.MAX_VALUE))
        );

        add(pnlListType, java.awt.BorderLayout.CENTER);
    }// </editor-fold>//GEN-END:initComponents

    private void txtTyCodeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtTyCodeActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtTyCodeActionPerformed

    private void txtTyNameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtTyNameActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtTyNameActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnTypeListAdd;
    private javax.swing.JButton btnTypeListDel;
    private javax.swing.JButton btnTypeListEdit;
    private javax.swing.JButton btnTypeListSearch;
    private javax.swing.JButton btnTypePrint;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JLabel lblHeadListType;
    private javax.swing.JLabel lblTyCode;
    private javax.swing.JLabel lblTyName;
    private javax.swing.JPanel pnlHeadListType;
    private javax.swing.JPanel pnlListType;
    private javax.swing.JTable tblListType;
    private javax.swing.JTextField txtTyCode;
    private javax.swing.JTextField txtTyName;
    // End of variables declaration//GEN-END:variables

}
